<%-- 
    Document   : sachAll
    Created on : May 20, 2013, 8:17:15 PM
    Author     : quannq
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<div class="pagination-container" id="pagination_contents">

    <div class="pagination cm-pagination-wraper center clear">
        <div class="p-list-nav p-list-nav-top">

            <div class="p-list-func clearfix">
                <div class="p-list-sort">Hiển thị từ <strong><?php echo (int) $offset + 1; ?></strong> đến <strong><?php echo (int) count($list) + (int) $offset; ?></strong> trong <strong><?php echo $count; ?></strong> sản phẩm</div>
                <div class="p-list-page">
                    <ul>
                        <?php if ($mamodule == 1) { ?>
                        <?php for ($i = 1; $i <= $soTrang; $i++) { ?>
                        <li><a href="xemtatca.php?id=1&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php } else if ($mamodule == 2) { ?>
                        <?php for ($i = 1; $i <= $soTrang; $i++) { ?>
                        <li><a href="xemtatca.php?id=2&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php } else if ($mamodule == 3) { ?>
                        <?php for ($i = 1; $i <= $soTrang; $i++) { ?>
                        <li><a href="xemtatca.php?id=3&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php } else { ?>
                        <?php for ($i = 1; $i <= $soTrang; $i++) { ?>
                        <li><a href="xemtatca.php?id=4&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php } ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="product_list">
        <?php (int) $stt = (int) $offset + 1; ?>
        <?php foreach ($list as $value) { ?>
        <div class="product_item clearfix first">
            <div class="num"><?php echo $stt++; ?>.</div>
            <div class="thumb center" style="width:120px">
                <a href="sach.php?idsach=<?php echo $value[0]; ?>" title="<?php echo $value[1]; ?>">
                    <img class="" src="<?php echo $value[14]; ?>" alt="<?php echo $value[1]; ?>" border="0" height="143" width="95"/>
                </a>
                <div style="margin-top: 5px; text-align: center; color: rgb(102, 102, 102); font-size: 11px;">Mã: <?php echo $value[0]; ?></div>
            </div>
            <!-- /.thumb -->

            <div class="info sale">
                <h2><a href="sach.php?idsach=<?php echo $value[0]; ?>"><?php echo $value[1]; ?></a>
                </h2>
                <p class="produect_feature">
                    Tác giả:&nbsp;<span><a href="sachtacgia.php?idtg=<?php echo $value[17]; ?>&page=1">
                            <?php echo $value[4]; ?></a></span><br><?php echo $value[3]; ?>.&nbsp;Xuất bản&nbsp; <?php echo date('d-m-Y', strtotime($value[15])); ?>.&nbsp;
                    <span>
                        <a href="sachnxb.php?idnxb=<?php echo $value[18]; ?>&page=1"><?php echo $value[10]; ?></a>
                    </span><br>
                    <!---->Số trang: <?php echo $value[7]; ?>.&nbsp;Kích thước: <?php echo $value[8]; ?>.&nbsp;Cân nặng: <?php echo $value[9]; ?>&nbsp;gr
                </p>
                <!--                        <div class="rating"><span class="star star_0"></span>(<a href="">0 nhận xét</a>)</div><div class="ranking">Xếp hạng 7 trong "<a href="#">Top 100 sẩn phẩm bán chạy</a>"</div>-->
                <div class="clearfix">
                    <dl class="clearfix">
                        <dt>Giá bìa:</dt>
                        <dd class="price_bia"><span><span id="sec_original_price_71606"><?php echo number_format($value[5],"0",",","."); ?></span>&nbsp;VNĐ</span>
                        </dd>
                        <dt>Giá bán:</dt>
                        <dd class="price_ban">
                            <?php (int) $giaban = ((int) $value[5] - (int) $value[5] * (int) $value[6] / 100); ?>
                            <span><span id="sec_sell_price_71606"><?php echo number_format($giaban,"0",",","."); ?></span>&nbsp;VNĐ</span>
                        </dd>
                    </dl>
                </div>        </div>
            <!-- /.info -->

            <div class="product_function">
                <form class="cm-ajax" action="http://nhasachphuongnam.com/index.php" method="post" name="product_form_71606" enctype="multipart/form-data">
                    <?php if ((int) $value[19] > 0) { ?>
                    <div name="" class="p-button p-add-to-cart p-button-red cm-submit-link" onclick="">
                        <span class="p-button-start"><span class="p-addcart-icon"></span>Cho vào giỏ hàng</span>
                        <span class="p-button-end"></span>
                    </div>
                    <?php } else { ?>
                    <div name="" class="p-button p-button-black cm-submit-link">
                        <span class="p-button-start">Sản phẩm đã hết hàng</span>
                        <span class="p-button-end"/>
                    </div>
                    <?php } ?>
                </form>
            </div>
            <!-- /.product_function -->        
        </div>
        <?php } ?>
        <!-- /.product_item -->
    </div>


    <div class="pagination cm-pagination-wraper center clear">
        <div class="p-list-nav p-list-nav-bottom">

            <div class="p-list-func clearfix">
                <div class="p-list-sort">Hiển thị từ <strong><?php echo (int) $offset + 1; ?></strong> đến <strong><?php echo (int) count($list) + (int) $offset; ?></strong> trong <strong><?php echo $count; ?></strong> sản phẩm</div>
                <div class="p-list-page">
                    <ul>
                        <?php if ($mamodule == 1) { ?>
                        <?php for ($i = 1; $i <= $soTrang; $i++) { ?>
                        <li><a href="xemtatca.php?id=1&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php } else if ($mamodule == 2) { ?>
                        <?php for ($i = 1; $i <= $soTrang; $i++) { ?>
                        <li><a href="xemtatca.php?id=2&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php } else if ($mamodule == 3) { ?>
                        <?php for ($i = 1; $i <= $soTrang; $i++) { ?>
                        <li><a href="xemtatca.php?id=3&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php } else { ?>
                        <?php for ($i = 1; $i <= $soTrang; $i++) { ?>
                        <li><a href="xemtatca.php?id=4&page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php } ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
